<!DOCTYPE html PUBLIC>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>修改用户状态</title>
    <link href="$!webPath/css/template.css" rel="stylesheet" type="text/css"/>
    <link href="$!webPath/css/jquery-ui-1.8.22.custom.css" type="text/css" rel="stylesheet">
    <script src="$!webPath/js/jquery-1.6.2.js"></script>
    <script src="$!webPath/js/jquery-ui-1.8.21.js"></script>
    <script src="$!webPath/js/ajaxfileupload.js"></script>

    <style type="text/css">
        label.error {
            color: #F00;
            margin-left: 3px;
        }

        input.error {
            border: 2px solid #F00;
        }
    </style>
</head>
<body>
<div class="header_nav">
    <iframe name="content_frame" src="$!webPath/admin/nav" marginwidth=0 marginheight=0  frameborder=0 width=100% height=80/></iframe>
    <div class="cont_right"><a href="$!webPath/login">注销</a></div>
</div>
<div class="cont">
    <h3 class="seth">编辑</h3>
    <div class="nav_list">
        <ul id="ul_table">
            <li><a href="$!webPath/admin/list_all_user?size=10&page=0"><b>用户列表</b></a></li>
            <li><a href="javascript:void(0);" class="this"><b>编辑</b></a></li>
        </ul>
    </div>
    <div class="adddetail">
        <form action="$!webPath/admin/" method="post" name="theForm" id="theForm">
            <div class="edit">
                <div class="setcont editul">
                    <ul class="set1">
                        <li class="setcont_bg">用户名</li>
                        <li>
                        <span class="webname">
                            <input type="text" id="userName" value="$!user.userName"/>
                        </span>
                        </li>
                    </ul>
                    <ul class="set1">
                        <li class="setcont_bg">用户昵称</li>
                        <li>
                        <span class="webname">
                            <input type="text" id="nickName" value="$!user.nickname"/>
                        </span>
                        </li>
                    </ul>
                    <ul class="set1">
                        <li class="setcont_bg">用户状态</li>
                        <li>
                        <span class="webname">
                            #if($!user.userStatus==0)
                              <select class="userStatus">
                                  <option value="0" selected>未激活</option>
                                  <option value="1">已激活</option>
                              </select>
                            #else
                            <select class="userStatus">
                                <option value="0" >未激活</option>
                                <option value="1" selected>已激活</option>
                            </select>
                            #end
                        </span>
                        </li>
                    </ul>

                </div>
            </div>


        </form>
        <div class="submit">
        <span class="pad120">
    <input name="save" type="button" value="提交" id="saveForm">
    </span>
        </div>
    </div>
</div>
<script>
    $('#saveForm').click(function(){
        var userStatus=$('.userStatus option:selected').val();
        var userName=$('#userName').val();
        var nickName=$('#nickName').val();
        //alert('userStatus='+userStatus)
        var get_data={
            userStatus:userStatus,
            userId:'$!user.id',
            userName : userName,
            nickName : nickName
        }
        $.ajax({
            url:'$!webPath/admin/modify_user',
            type:'post',
            data:get_data,
            success: function () {
                //alert('成功');
                window.location.href = "$!webPath/admin/list_all_user?size=10&page=0";
            },
            error:function(){
                alert('失败');
            }
        })
    })
</script>
</body>
</html>
